package com.laivi.basic.model.file.writer;

import java.io.File;

public class ExcelWriter implements IExcelWriter{

	private IExcelWriter writer;
	
	public ExcelWriter(String path){
		this(new File(path));
	}
	
	public ExcelWriter(File file){
		if(file.getName().indexOf(".xlsx")!=-1){
			writer=new XlsxWriter(file);
		}else{
			writer=new XlsWriter(file);
		}
	}

	@Override
	public void setSheet(int index) {
		writer.setSheet(index);
	}

	@Override
	public void writeCell(int row, int col, String content) {
		writer.writeCell(row, col, content);
	}

	@Override
	public void writeCell(int row, char col, String content) {
		writer.writeCell(row, col, content);
	}

	@Override
	public void close() {
		writer.close();
	}
}
